package com.proba.annotations.pojo;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * <p>Pojo mapping TABLE MAVROVO.TIP_POTROSEN_MATERIJAL</p>
 *
 * <p>Generated at Mon May 10 22:57:47 CEST 2010</p>
 * @author Salto-db Generator v1.0.16 / EJB3
 * 
 */
@Entity
@Table(name = "TIP_POTROSEN_MATERIJAL", schema = "MAVROVO")
@SuppressWarnings("serial")
@javax.persistence.SequenceGenerator(
    name="tip_potrosen_materijal_seq",
    sequenceName="tip_potrosen_materijal_seq", allocationSize=1
)
public class TipPotrosenMaterijal implements Serializable {

	/**
	 * Attribute id.
	 */
	private Long id;
	
	/**
	 * Attribute tipPotrosenMaterijal.
	 */
	private String tipPotrosenMaterijal;
	
	/**
	 * List of PotrosenMaterijal
	 */
	private List<PotrosenMaterijal> potrosenMaterijals = null;

	
	/**
	 * @return id
	 */
	@Basic
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="tip_potrosen_materijal_seq")
		public Long getId() {
		return id;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TipPotrosenMaterijal other = (TipPotrosenMaterijal) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	/**
	 * @param id new value for id 
	 */
	public void setId(Long id) {
		this.id = id;
	}
	
	/**
	 * @return tipPotrosenMaterijal
	 */
	@Basic
	@Column(name = "TIP_POTROSEN_MATERIJAL", length = 100)
		public String getTipPotrosenMaterijal() {
		return tipPotrosenMaterijal;
	}

	/**
	 * @param tipPotrosenMaterijal new value for tipPotrosenMaterijal 
	 */
	public void setTipPotrosenMaterijal(String tipPotrosenMaterijal) {
		this.tipPotrosenMaterijal = tipPotrosenMaterijal;
	}
	
	/**
	 * Get the list of PotrosenMaterijal
	 */
	 @OneToMany(mappedBy="tipPotrosenMaterijal")
	 public List<PotrosenMaterijal> getPotrosenMaterijals() {
	 	return this.potrosenMaterijals;
	 }
	 
	/**
	 * Set the list of PotrosenMaterijal
	 */
	 public void setPotrosenMaterijals(List<PotrosenMaterijal> potrosenMaterijals) {
	 	this.potrosenMaterijals = potrosenMaterijals;
	 }
	 
	 public String toString() {
		 return this.tipPotrosenMaterijal;
	 }


}